<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="common/template :: res(title='项目列表')">

</head>
<body>
	<script type="text/javascript">
		$(function() {
			$('#ctable').bootstrapTable({
				url : 'q/project',
				method : 'get',
				striped : true,
				search : "true",
				showColumns : "true",
				showFooter : "true",

				columns : [ {
					field : 'merDate',
					title : '登记日期'
				}, {
					field : 'projectNo',
					title : '项目编号'
				}, {
					field : 'projectName',
					title : '项目名称'
				}, {
					field : 'projectAmt',
					title : '项目金额'
				}, {
					field : 'avaAmount',
					title : '可投金额'
				}, {
					field : 'loanAmount',
					title : '可放款金额'
				}, {
					field : 'rateVal',
					title : '利率(%)'
				}, {
					field : 'projectUse',
					title : '项目用途'
				}, {
					field : 'finaAccType',
					title : '融资方用户类型',
					formatter:function(value){
						return value==1?"个人":"企业"
					}
				}, {
					field : 'finaCertNo',
					title : '融资方证件号'
				} , {
					field : 'finaName',
					title : '融资方姓名'
				}, {
					field : 'assureName',
					title : '担保方姓名'
				}, {
					field : 'assureAmount',
					title : '担保金额'
				}, {
					field : 'assureIncome',
					title : '担保方收益'
				},{
		        	 field: 'oper',
			         title:'操作',
			         formatter:function(value,row,index){
			        	 var html= '<button type="button" class="btn btn-default" data-pn="'+row.projectNo+'" role="inverstList">投资列表</button> &nbsp;';
			        	 html += '<button type="button" class="btn btn-default" data-pn="'+row.projectNo+'" role="loan">放款</button> &nbsp;';
			        	 return html;
			         }
		        }]

			});
			
			
			//support IE
			$('#ctable').on('post-body.bs.table',function(){
				$('button[role=inverstList]').click(function() {
					var pn=this.dataset.pn;
					location.href=("redirect?redirect=list/inverst#"+pn);
				});
				$('button[role=loan]').click(function() {
					var pn=this.dataset.pn;
					doRequest({
						url:'loan',
						type:'POST',
						data:{
							projectNo:pn
						}
					},function(data){
						print('放款成功');
					});
				});
			});

		});
	</script>
	<div class="alert alert-success toptips" role="alert" id="js_tooltips"  style="display:none;z-index:100;">信息展示窗口</div>
	<div class="page-header">
		<h2>
			江苏亦融在线 <small>支付调试</small>
		</h2>

	</div>
	<ol class="breadcrumb">
		<li><a href="index">首页</a></li>
		<li class="active">项目列表</li>
	</ol>
	<table id="ctable">
	</table>


</body>
</html>